package com.softeem.xyblogmaster.generator;

import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.springframework.stereotype.Component;


@Component
public class ZtIdGererator implements IdentifierGenerator {

    @Override
    public Number nextId(Object entity) {
        return null;
    }


    @Override
    public boolean assignId(Object idValue) {
        return IdentifierGenerator.super.assignId(idValue);
    }

    //在原来的基础上了加了一个前缀
    /**
     * 雪花算法
     */
    @Override
    public String nextUUID(Object entity) {
        return "zt_11_"+IdentifierGenerator.super.nextUUID(entity);
    }
}
